import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Layout',
    redirect: '/first',
    component: () => import('@/views/Layout/index.vue'),
    children: [
      { path: '/first', name: 'first', component: () => import('@/views/First/index.vue') },
      { path: '/second', name: 'second', component: () => import('@/views/Second/index.vue') },
      { path: '/third/:third', name: 'third', component: () => import('@/views/third/index.vue') },
      { path: '/forth/:id', name: 'forth', component: () => import('@/views/Forth/index.vue') }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
